﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsGame4
{
    class Direction2D
    {
        private int x;
        private int y;

        public Direction2D(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        public int X
        {
            get { return x; }
            set { x = value; }
        }

        public int Y
        {
            get { return y; }
            set { y = value; }
        }

        public String getDirection()
        {
            if (x == 0 && y == 0)
                return "stop";
            if (x == 1 && y == 0)
                return "right";
            if (x == -1 && y == 0)
                return "left";
            if (x == 0 && y == 1)
                return "down";
            if (x == 0 && y == -1)
                return "up";
            return "error";
        }      
    }
}
